 <?php
 session_start();
 
 
 if (isset($_POST["login"])) {
 
 $link = mysql_connect("localhost", "root", "root")
    or die("Impossible de se connecter : " . mysql_error());
    
mysql_select_db("doranco",$link);





$query = sprintf("INSERT into user (login, password) VALUES  
    ('%s', '%s')",
    mysql_real_escape_string($_POST["login"]),
    mysql_real_escape_string(sha1($pass)));



$result = mysql_query($query) or die("Insert impossible");

$_SESSION["login"] = $_POST["login"];

header("LOCATION: secret.php");

 
}
 
 
 ?>
 
 
 
 
 
 <form method="POST" action="registrer.php">
    Merci de rentrer votre pseudo : <input type="text" name="login" value="votre pseudo"/>
    Password : <input type="password" name="password" />
    <br /><br />
    <input type="submit" value="Valider" />
    </form>
